package tothreedesignmodel.composite;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author lzhphantom
 * @description
 * @date 创建于 18:28 2020/8/1
 * @modified
 */
@Data
@AllArgsConstructor
public class Goods implements Articles {
    private String name;
    private int quantity;
    private float unitPrice;

    @Override
    public float calculation() {
        return getQuantity()*getUnitPrice();
    }

    @Override
    public void show() {
        System.out.println(getName()+"[quantity:"+getUnitPrice()+" - unitPrice:"+getUnitPrice()+"￥]");
    }
}
